/*    */ package com.zimbra.qa.unittest.prov;
/*    */ 
/*    */ import com.zimbra.common.localconfig.KnownKey;
/*    */ import java.io.IOException;
/*    */ import java.io.PrintStream;
/*    */ import org.junit.Assert;
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ public class LocalconfigTestUtil
/*    */ {
/*    */   public static void modifyLocalConfig(KnownKey key, String value)
/*    */     throws Exception
/*    */   {
/* 28 */     String keyName = key.key();
/*    */     
/* 30 */     Process process = null;
/*    */     try {
/* 32 */       String command = "/opt/zimbra/bin/zmlocalconfig -e " + keyName + "=" + value;
/* 33 */       System.out.println(command);
/* 34 */       process = Runtime.getRuntime().exec(command);
/*    */     } catch (IOException e) {
/* 36 */       e.printStackTrace();
/* 37 */       throw e;
/*    */     }
/*    */     
/*    */     try
/*    */     {
/* 42 */       int exitCode = process.waitFor();
/* 43 */       Assert.assertEquals(0L, exitCode);
/*    */     } catch (InterruptedException e) {
/* 45 */       e.printStackTrace();
/* 46 */       throw e;
/*    */     }
/*    */   }
/*    */   
/*    */   public static void modifyLocalConfigTransient(KnownKey key, String value) {
/* 51 */     key.setDefault(value);
/*    */   }
/*    */ }


/* Location:              /home/mint/zimbrastore.jar!/com/zimbra/qa/unittest/prov/LocalconfigTestUtil.class
 * Java compiler version: 7 (51.0)
 * JD-Core Version:       0.7.1
 */